package com.lancoo.cvas.pojo.response.basicPlatform;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.lancoo.cvas.entity.Course;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @ClassName BaseCourse
 * @Description 教务系统 课程库
 * @Author quin
 * @Date 2023/4/17 10:40
 */
@NoArgsConstructor
@Data
public class BaseCourse {

    @JsonProperty("Term")
    private String term;
    @JsonProperty("CourseNO")
    private String courseNO;
    @JsonProperty("CourseName")
    private String courseName;
    @JsonProperty("CourseNumber")
    private String courseNumber;
    @JsonProperty("CourseCredit")
    private Double courseCredit;
    @JsonProperty("TotalHours")
    private Integer totalHours;
    @JsonProperty("KindID")
    private String kindID;
    @JsonProperty("KindName")
    private String kindName;
    @JsonProperty("CourseProp")
    private Integer courseProp;
    @JsonProperty("MajorProp")
    private Integer majorProp;
    @JsonProperty("LectureHours")
    private Integer lectureHours;
    @JsonProperty("ExperimentHours")
    private Integer experimentHours;
    @JsonProperty("OperationHours")
    private Integer operationHours;
    @JsonProperty("OtherHours")
    private Integer otherHours;


    @JsonProperty("EnglishName")
    private String englishName;


    public Course toCourse(Integer taskId) {
        return new Course()
                .setTaskId(taskId)
                .setBaseCourseId(courseNO)
                .setCourseName(courseName)
                .setCourseTypeId(kindID)
                .setCourseType(kindName)
                .setCourseNature(courseProp)
                .setMajorProp(majorProp)
                .setCourseCode(courseNumber)
                .setCredit(courseCredit)
                .setLectureHour(lectureHours)
                .setExperimentalHour(experimentHours)
                .setComputerHour(operationHours)
                .setOtherHour(otherHours)
                .setIsEnable(0);
    }

}
